import { $get, $post, $put, $del } from 'utils/request'

//test
export let getHallRecommendApi = async (params) => {
  let url = `/basic/industry/category?parentId=0`
  let data = await $get(url, params)
  return data
}

// 个人设置-账号设置-任职状态
export let getLovValueInfoApi = async (params) => {
  let url = `$ztnt/v1/$tenantId/lov-value/info`
  let data = await $get(url, params)
  return data
}
// 个人设置-账号设置-基本信息
export let getUserInfoApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/${userId}`
  let data = await $get(url, params)
  return data
}
// 身份管理 企业员工邮箱 list表
export let empMineListApi = async () => {
  let url = `$zemd/v1/$tenantId/emp/mine`
  let data = await $post(url)
  return data
}
// 个人设置-账号设置-保存基本信息
export let putUserInfoApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/${userId}`
  let data = await $put(url, params)
  return data
}

// 个人设置-账号设置-邮箱验证
export let getEmailValidateApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/send/email-validate`
  let data = await $get(url, params)
  return data
}
// 个人设置-账号设置-邮箱验证
export let getEmailValidateUpdataApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/send/email-validate-update`
  let data = await $get(url, params)
  return data
}
// 个人设置-账号设置-获取验证码
export let getPhoneValidateApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/send/phone-validate`
  let data = await $get(url, params)
  return data
}
// 更换手机号 更换邮箱-获取验证码
export let accountCaptchaApi = async (params) => {
  let url = `$ziam/v1/$tenantId/user/modify/account/captcha`
  let data = await $get(url, params)
  return data
}
// 更换手机号 更换邮箱
export let modifyAccountApi = async (params) => {
  let url = `$ziam/v1/$tenantId/user/modify/account`
  let data = await $put(url, params)
  return data
}

// 个人设置-账号设置-验证手机
export let postPhoneValidateApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/phone-validate`
  let data = await $post(url, params)
  return data
}
// 个人设置-账号设置-修改密码
export let postUpdatePasswordApi = async (params, userId) => {
  let url = `$ziam/v1/user/update-password`
  let data = await $post(url, params)
  return data
}

// 个人设置-身份管理
export let getIdentityInfoApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/identity-info`
  let data = await $get(url, params)
  return data
}

// 个人设置-身份管理-设置默认身份
export let postSettingEmpDefaultApi = async (params, userId) => {
  let url = `$zemd/v1/$tenantId/emp/${userId}/setting-emp-default`
  let data = await $post(url, params)
  return data
}

// 个人设置-身份管理-退出租户
export let postExitTenantApi = async (params, empTenantId, userId) => {
  let url = `$zemd/v1/$tenantId/emp/sign-out/tenant/${empTenantId}/user/${userId}`
  let data = await $post(url, params)
  return data
}

// 个人设置-地址管理
export let getAddressApi = async (params, empTenantId, userId) => {
  let url = `$ztnt/v1/$tenantId/address`
  let data = await $get(url, params)
  return data
}

// 个人设置-地址管理-设为默认收货地址
export let postAddressDefultReceiveApi = async (params) => {
  let url = `$ztnt/v1/$tenantId/address/defult-receive`
  let data = await $post(url, params)
  return data
}
// 个人设置-地址管理
export let postAddressdefultInvoiceApi = async (params) => {
  let url = `$ztnt/v1/$tenantId/address/defult-invoice`
  let data = await $post(url, params)
  return data
}

// 个人设置-地址管理 - 添加地址
export let postAddressApi = async (params) => {
  let url = `$ztnt/v1/$tenantId/address`
  let data = await $post(url, params)
  return data
}
// 个人设置-地址管理 - 编辑地址
export let putAddressApi = async (params) => {
  let url = `$ztnt/v1/$tenantId/address`
  let data = await $put(url, params)
  return data
}

// 个人设置-地址管理 - 删除地址
export let delAddressApi = async (params) => {
  let url = `$ztnt/v1/$tenantId/address`
  let data = await $del(url, params)
  return data
}

// 切换用户
export let postSwitchUserApi = async (params, userId) => {
  let url = `$ziam/v1/$tenantId/user/switch-user/${userId}`
  let data = await $post(url, params)
  return data
}

// 代办设置详情
export let getReplaceHandleApi = async (params, userId) => {
  let url = `$zwkf/v1/$tenantId/replace-handle/${userId}`
  let data = await $get(url, params)
  return data
}

// 保存代办设置
export let postReplaceHandleApi = async (params, userId) => {
  let url = `$zwkf/v1/$tenantId/replace-handle`
  let data = await $post(url, params)
  return data
}

// 员工管理-员工列表
export let getEmpApi = async (params) => {
  let url = `$zemd/v1/$tenantId/emp`
  let data = await $get(url, params)
  return data
}
// 查询当前登录用户的信息
export let getUserSelf = async (params) => {
  let url = `$ziam/v1/user/self`
  let data = await $get(url, params)
  return data
}

// 用户偏好 根据缓存key保存当前用户数据
export let setUserPreferenceApi = async (params, key) => {
  let url = `$ztnt/v1/$tenantId/user-preference?preferenceKey=${key}`
  let data = await $post(url, params)
  return data
}
// 获取消息设置
export let getMessageSendReceiveApi = async (params) => {
  let url = `$zmsg/v1/$tenantId/message-send-receive`
  let data = await $get(url, params)
  return data
}
// 设计消息设置
export let setMessageSendReceiveApi = async (params) => {
  let url = `$zmsg/v1/$tenantId/message-send-receive`
  let data = await $post(url, params)
  return data
}

// 获取省
export let getProvinceApi = async (params) => {
  let url = `/basic/v1/$tenantId/area/queryOneLevelAreaList`
  let data = await $get(url, params)
  return data
}
// 获取市、区、县、街道
export let getAreaApi = async (params) => {
  let url = `/basic/v1/$tenantId/area/queryAreaList`
  let data = await $get(url, params)
  return data
}
// 加入企业记录list表
export let companyMimePageApi = async (params) => {
  let url = `/ztnt/v1/$tenantId/company/apply/mime/page`
  let data = await $post(url, params)
  return data
}
// 员工管理-员工解除与用户/用户解除与员工的关系
export let getempUserId = async (empId) => {
  let url = `$zemd/v1/$tenantId/emp/dismiss/user/${empId}`
  let data = await $post(url)
  return data
}